package com.loong;

import java.util.Arrays;

public class Client {
    public static void main(String[] args) {
        int[] scores = {5, 3, 8, 6, 2};
        ScoreOperation adapter = new OperationAdapter();
        System.out.println("原始成绩：" + Arrays.toString(scores));

        int[] sortedScores = adapter.Sort(scores);
        System.out.println("排序成绩："+  Arrays.toString(sortedScores));
        int key = 6;
        int index = adapter.Search(sortedScores, key);
        if (index != -1) {
            System.out.println("找到元素 " + key + "，索引为 " + index);
        } else {
            System.out.println("未找到元素 " + key);
        }
    }
}